
#导入yaml文件包
import yaml
#导入qq邮箱包
import yagmail
#导入日志包
import logging

#封装日志
def log(time):
    logging.basicConfig(filename=f'./{time}.log',filemode='a+',format='%(levelname)s -> %(asctime)s ->%(message)s',level=logging.DEBUG)

#封装qq封装方法
def sen(fliep):
    sed=yagmail.SMTP(user='1006142636@qq.com',password='hygnwdryluhsbgac',host='smtp.qq.com')
    sed.send(to='1006142636@qq.com',subject='酒仙网系统webui自动化测试报告+当前的日志',contents='今日报告请查看',attachments=fliep)

#封装yaml读取方法
def yaml1(filep):
    with open(filep,'r',encoding='utf-8')as e:
        return yaml.safe_load(e)
